package com.harboursoftware.xstorage.results;

import java.io.IOException;
import java.io.InputStream;

import com.harboursoftware.xstorage.io.EmptyInputStream;

/**
 * 内容为空的响应，只带Headers
 * 
 * @author Simon Leung
 * @since 0.1
 */
public class EmptyContentResult extends Result {
    //TODO: 是否百下面的变量名变成有意义的名字：如SUCCESS
    //不能够静态因为有几个属性必须随机生成
    //public final static EmptyContentResult CODE_200 = new EmptyContentResult(200);
    //public final static EmptyContentResult CODE_204 = new EmptyContentResult(204);
    //public final static EmptyContentResult CODE_304 = new EmptyContentResult(304);
    //precondition failed
    //public final static EmptyContentResult CODE_412 = new EmptyContentResult(412);
    /**
     * default constructor,create instance with status code 200.
     */
    public EmptyContentResult() {
        setHeaderContentLength(0);
        this.status = 200;
        this.inputStream = EmptyInputStream.getInstance();
    }
    
    public EmptyContentResult(int status) {
        setHeaderContentLength(0);
        this.status = status;
        this.inputStream = EmptyInputStream.getInstance();
    }
}
